/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.bean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Zully
 */
@Entity
@Table(name = "almacenes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Almacenes.findAll", query = "SELECT a FROM Almacenes a"),
    @NamedQuery(name = "Almacenes.findById", query = "SELECT a FROM Almacenes a WHERE a.id = :id"),
    @NamedQuery(name = "Almacenes.findByNombre", query = "SELECT a FROM Almacenes a WHERE a.nombre = :nombre"),
    @NamedQuery(name = "Almacenes.findByDireccion", query = "SELECT a FROM Almacenes a WHERE a.direccion = :direccion"),
    @NamedQuery(name = "Almacenes.findByTelefono", query = "SELECT a FROM Almacenes a WHERE a.telefono = :telefono"),
    @NamedQuery(name = "Almacenes.findByFax", query = "SELECT a FROM Almacenes a WHERE a.fax = :fax"),
    @NamedQuery(name = "Almacenes.findByEmail", query = "SELECT a FROM Almacenes a WHERE a.email = :email"),
    @NamedQuery(name = "Almacenes.findByEncargado", query = "SELECT a FROM Almacenes a WHERE a.encargado = :encargado"),
    @NamedQuery(name = "Almacenes.findByEstado", query = "SELECT a FROM Almacenes a WHERE a.estado = :estado")})
public class Almacenes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "direccion")
    private String direccion;
    @Column(name = "telefono")
    private String telefono;
    @Column(name = "fax")
    private String fax;
    @Column(name = "email")
    private String email;
    @Column(name = "encargado")
    private String encargado;
    @Lob
    @Column(name = "comentarios")
    private String comentarios;
    @Basic(optional = false)
    @Column(name = "estado")
    private boolean estado;
    @OneToMany(mappedBy = "idAlmacen", fetch = FetchType.LAZY)
    private List<Neumaticos> neumaticosList;

    public Almacenes() {
    }

    public Almacenes(Integer id) {
        this.id = id;
    }

    public Almacenes(Integer id, String nombre, boolean estado) {
        this.id = id;
        this.nombre = nombre;
        this.estado = estado;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEncargado() {
        return encargado;
    }

    public void setEncargado(String encargado) {
        this.encargado = encargado;
    }

    public String getComentarios() {
        return comentarios;
    }

    public void setComentarios(String comentarios) {
        this.comentarios = comentarios;
    }

    public boolean getEstado() {
        return estado;
    }

    public void setEstado(boolean estado) {
        this.estado = estado;
    }

    @XmlTransient
    public List<Neumaticos> getNeumaticosList() {
        return neumaticosList;
    }

    public void setNeumaticosList(List<Neumaticos> neumaticosList) {
        this.neumaticosList = neumaticosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Almacenes)) {
            return false;
        }
        Almacenes other = (Almacenes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nombre;
    }
    
}
